package com.lys.dao;

import com.lys.entity.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品查询Dao
 *
 * deleteById(Integer id)
 * getById(Integer id)
 * getRowCount(params)
 * getRowList(params)
 *
 */
@Mapper
public interface ProductDao  {

	Integer updateStock(@Param("id") Integer id,@Param("quantity") Integer quantity) throws Exception;
	
	public Integer add(Product product) throws Exception;

	public Integer update(Product product) throws Exception;
	
	public Integer deleteProductById(@Param("id") Integer id) throws Exception;
	
	public Product getProductById(@Param("id") Integer id) throws Exception;
	
	public List<Product> getProductList(@Param("currentPageNo") Integer currentPageNo,
										@Param("pageSize") Integer pageSize,
										@Param("name") String name,
										@Param("categoryId") Integer categoryId,
										Integer level)throws Exception;
	
	public Integer queryProductCount(@Param("name") String name,
									 @Param("categoryId") Integer categoryId,
									 Integer level)throws Exception;
}
